﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sicurezza.Entita;
using Sicurezza.Manager;

namespace Sicurezza.Client.Manager
{
    public class SignedMessageManager
    {
        public static SignedMessage Load(string filepath)
        {
            string message = FileManager.LoadFile(filepath);
            SignedMessage sm = null;
            try
            {
                sm = XmlManager.DeserializeSignedMessage(message);
            }
            catch (Exception ex)
            {
                throw new Exception("Cannot load file. File is not in correct format.");
            }

            return sm;
        }
    }
}
